package cn.ffcs.uec.recordsApproval.vo;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import cn.ffcs.uec.recordsApproval.model.AtiUser;
import cn.ffcs.uom.common.model.DefaultDaoFactory;
import cn.ffcs.uom.common.util.StrUtil;
import lombok.Getter;
import lombok.Setter;

/**
 * 流程流转信息Vo
 * 
 * @author liuxiaodong
 *
 */
@Getter
@Setter
public class HistoricFlow implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 3780245937925955770L;

	private Integer actNum;

	private String taskDefKey;

	private String assignee;

	private String comment;

	private Date startTime;

	private Date endTime;

	private String duringTime;

	public String getAssigneeName() {
		if (!StrUtil.isNullOrEmpty(assignee)) {
			String sql = " SELECT * FROM ATI_USER U WHERE U.NO = ? ";
			List<Object> params = new ArrayList<Object>();
			params.add(assignee);
			AtiUser user = DefaultDaoFactory.getDefaultDao().jdbcFindObject(sql, params, AtiUser.class);
			return user.getName();
		}
		return assignee;
	}

}
